home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / MOD2TXT.ZIP / CHAP16.TXT < prev    next >
Text File  |  1987-03-25  |  4KB  |  124 lines

  1.                    Chapter 16 - Complete example programs
  2.  
  3.  
  4.              The  intent of this chapter is to give several  example
  5.         programs  that  use nearly every capability of  Modula-2  as
  6.         illustrations  of large usable programs.   The programs  are
  7.         usable  utilities,   but  primarily  they  are  intended  to
  8.         illustrate  the method of building up a medium sized program
  9.         from the various constructs studied in the earlier chapters.
  10.  
  11.                                  BAKLIST.MOD
  12.  
  13.              This  program generates a list of all files along  with
  14.         their subdirectories. Some files are excluded from the list,
  15.         including  all three files that comprise the DOS system  and
  16.         the  file generated here,  FULLDISK.LST.   This is an  ASCII
  17.         file  that  can be edited with any text editor to  eliminate
  18.         any  files that you do not wish to back up.   It  should  be
  19.         noted that the file,  FULLDISK.LST, is created and filled in
  20.         the  root  directory  of the  default  drive.
  21.  
  22.              Select  the desired subdirectory that you wish to  back
  23.         up,   and  the  files,  subdirectories,  and  all  of  their
  24.         respective  contents  will be listed in  FULLDISK.LST.   The
  25.         resulting list is then used by BAKCOPY to actually copy  the
  26.         files to a floppy disk.
  27.  
  28.                                  BAKCOPY.MOD
  29.  
  30.              This  program  uses FULLDISK.LST to actually  copy  the
  31.         files from the source disk to the target and requests a disk
  32.         change whenever the floppy disk fills up.   It will not copy
  33.         a file larger than that which will fit on one disk, but will
  34.         give a message of which files are not copied.
  35.  
  36.                                  BAKRSTR.MOD
  37.  
  38.              This  program will read the files from floppy  back  to
  39.         the  fixed  disk  to  restore it.   It  simply  copies  from
  40.         whatever   directory  they  are  in  to  the   corresponding
  41.         directory  on  the fixed disk,  creating  the  directory  if
  42.         necessary.
  43.  
  44.                          DIRHELPS.DEF   DIRHELPS.MOD
  45.  
  46.              This   global  module  contains  several  useful   file
  47.         handling  and  directory  manipulation  procedures.   It  is
  48.         called  by the above three example programs used for  backup
  49.         and  restore of a fixed disk.   These routines are available
  50.         for  your  use  also if you desire to use them  for  a  file
  51.         manipulation  program.   Their main intent however  is  that
  52.         they  be a guide for the student to observe methods used  to
  53.         write library functions.
  54.  
  55.  
  56.  
  57.                                  Page 99
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.                    Chapter 16 - Complete example programs
  68.  
  69.  
  70.                          BITOPS.DEF     BITOPS.MOD
  71.  
  72.              This  module has several generic bit operations such as
  73.         logical  AND,  OR,  etc.  and shift operations.   These  are
  74.         useful  procedures  that  you  can import and  use  in  your
  75.         programs if you are doing bit manipulations.
  76.  
  77.                          REAL2MON.DEF   REAL2MON.MOD
  78.  
  79.              This module has a procedure to output REAL data to  the
  80.         monitor in a neat, easy to read format.  It is documented in
  81.         the header of the source files.
  82.  
  83.                          REAL2FIL.DEF   REAL2FIL.MOD
  84.  
  85.              This  module has several procedures to output REAL  and
  86.         other data type to a file using the FileSystem MODULE.   The
  87.         various   procedures  are  documented  in  their  respective
  88.         headers.
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.                                  Page 100
  124.